package com.xishu.entity.customer;

import com.xishu.annotation.dao.DefaultValue;
import com.xishu.entity.AbstractEntity;
import com.xishu.entity.oplog.OpName;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 短信以及邮件的配额
 */
@Entity(name = "quota")
@Table(indexes = {@Index(columnList = "companyId")})
public class Quota extends AbstractEntity implements OpName {
    @Transient
    private String opName;

    @ApiModelProperty(value = "归属哪一个公司")
    private Long companyId;

    @ApiModelProperty(value = "计划邮件的已使用数")
    @DefaultValue(defaultValue = "0")
    private Integer emailUsed;

    @ApiModelProperty(value = "计划短信的已使用数")
    @DefaultValue(defaultValue = "0")
    private Integer smsUsed;

    @ApiModelProperty(value = "计划短信的可使用数")
    @DefaultValue(defaultValue = "0")
    private Integer smsCanUsed;

    @ApiModelProperty(value = "计划邮件的可使用数")
    @DefaultValue(defaultValue = "0")
    private Integer emailCanUsed;

    @ApiModelProperty(value = "非计划邮件的已使用数")
    @DefaultValue(defaultValue = "0")
    private Integer unPlanEmailUsed;

    @ApiModelProperty(value = "非计划短信的已使用数")
    @DefaultValue(defaultValue = "0")
    private Integer unPlanSmsUsed;

    @ApiModelProperty(value = "非计划短信的可使用数")
    @DefaultValue(defaultValue = "0")
    private Integer unPlanSmsCanUsed;

    @ApiModelProperty(value = "非计划邮件的可使用数")
    @DefaultValue(defaultValue = "0")
    private Integer unPlanEmailCanUsed;

    public Integer getSmsCanUsed() {
        return smsCanUsed;
    }

    public void setSmsCanUsed(Integer smsCanUsed) {
        this.smsCanUsed = smsCanUsed;
    }

    public Integer getEmailCanUsed() {
        return emailCanUsed;
    }

    public void setEmailCanUsed(Integer emailCanUsed) {
        this.emailCanUsed = emailCanUsed;
    }

    public Integer getUnPlanSmsCanUsed() {
        return unPlanSmsCanUsed;
    }

    public void setUnPlanSmsCanUsed(Integer unPlanSmsCanUsed) {
        this.unPlanSmsCanUsed = unPlanSmsCanUsed;
    }

    public Integer getUnPlanEmailCanUsed() {
        return unPlanEmailCanUsed;
    }

    public void setUnPlanEmailCanUsed(Integer unPlanEmailCanUsed) {
        this.unPlanEmailCanUsed = unPlanEmailCanUsed;
    }

    public Integer getUnPlanEmailUsed() {
        return unPlanEmailUsed;
    }

    public void setUnPlanEmailUsed(Integer unPlanEmailUsed) {
        this.unPlanEmailUsed = unPlanEmailUsed;
    }

    public Integer getUnPlanSmsUsed() {
        return unPlanSmsUsed;
    }

    public void setUnPlanSmsUsed(Integer unPlanSmsUsed) {
        this.unPlanSmsUsed = unPlanSmsUsed;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public Integer getEmailUsed() {
        return emailUsed;
    }

    public void setEmailUsed(Integer emailUsed) {
        this.emailUsed = emailUsed;
    }

    public Integer getSmsUsed() {
        return smsUsed;
    }

    public void setSmsUsed(Integer smsUsed) {
        this.smsUsed = smsUsed;
    }

    @Override
    public void setOpName(String str) {
        this.opName = str;
    }

    @Override
    public String getOpName() {
        return opName;
    }

    @Override
    public String opType() {
        return "短信/電郵額度";
    }

    @Override
    public String[] fieldName() {
        return new String[]{"companyId"};
    }
}
